package com.sk.ccflower.server.common.xmlRpcManager;

import java.io.IOException;

import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.xmlrpc.XmlRpcException;
import org.apache.xmlrpc.webserver.XmlRpcServletServer;

import com.sk.ccflower.server.lib.dbUtils.ConnectionPoolManager;


public class MyXmlRpcServlet extends ModXmlRpcServlet
{
	private static final long serialVersionUID=80000002L;
	private ConnectionPoolManager mConnectionPool = null;
	
	public MyXmlRpcServlet(ConnectionPoolManager connectionPool, String filename)
	{
		super(filename);
		mConnectionPool = connectionPool;
		
		try {
			super.setDbPool( mConnectionPool );
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
	@Override
	protected XmlRpcServletServer newXmlRpcServer(ServletConfig pConfig) throws XmlRpcException
	{
		return new MyXmlRpcServletServer();
	}
	
	@Override
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
	{
		doPost(request, response);
	}

	@Override
	public void doPost(HttpServletRequest pRequest, HttpServletResponse pResponse) throws ServletException, IOException
	{
		super.doPost(pRequest, pResponse);
	}
}
